import { selectPmGroupById } from "@/api/evalutaion"
import { ref } from "vue"

function useGroup() {


  let pmGroupById = ref<Evaluation.EvalutaionData>()

  function getPmGroupById(option: { pmGroupId: number, success?: (data: Evaluation.EvalutaionData) => void }) {
    selectPmGroupById({ pmGroupId: option.pmGroupId })
      .then(res => {
        pmGroupById.value = res.data
        option.success && option.success(res.data)
      })
      .catch(err => {
        console.log(err)
      })
  }

  return {
    getPmGroupById,
    pmGroupById
  }
}

export default useGroup